
<!DOCTYPE html>
<html>

<head>
	<title>Admin page-xcms</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<meta name="generator" content="Geany 0.20" />
	<link rel="stylesheet" href='screen.css'>
</head>

<body>
<div id='sidebar'>
<?php
function getnav($n){
	foreach($n->attributes() as $a => $b){
		$attr[$a]=$b;
	}
	if($n->getname()=="link"){
		echo "<li>",ucfirst($attr["href"]),"</li>";
		}
	else{
		echo "<li>",ucfirst($attr["href"]),"<ul>";
		loop($n);
		echo "</ul></li>";
	}
}
function loop($n){
	foreach( $n->children() AS $child ){
	getnav($child);
	}
	}
if (file_exists('../modules/nav/nav.xml')) {
    $nav = simplexml_load_file('../modules/nav/nav.xml');
    echo "<ul>";
	loop($nav);
	echo "</ul>";

} else {
    exit('The theme doesnt exist or corrupt');
}
?>

</div>
<div id='center'>

</div>
</body>

</html>
